package com.shanghaionstar.alarm;

/**
 * 闹钟类型：
 *
 * Created by Yonglang Hong on 2017/1/11.
 */
public enum AlarmActionType {

    VEHICLE_INSPECTION_ACTION(1,"vehicleInspectionAction");

    private int value;

    private String action;

    AlarmActionType(int value, String action) {
        this.value = value;
        this.action = action;
    }

    public int getValue() {
        return value;
    }

    public String getAction() {
        return action;
    }

    public static AlarmActionType valueOf(int value) {
        for(AlarmActionType type : AlarmActionType.values()) {
            if(type.getValue() == value) {
                return type;
            }
        }
        return null;
    }

    public static AlarmActionType actionOf(String action) {
        for(AlarmActionType type : AlarmActionType.values()) {
            if(action.equalsIgnoreCase(type.getAction())) {
                return type;
            }
        }
        return null;
    }
}
